package files;

import java.util.Random;

public class GenerateWord {

	public static String generateRandomWord(int wordLength, int wordCount,
			int wordLine) {
		Random r = new Random(); 
		StringBuilder sb = new StringBuilder(wordLength);
		for (int k = 1; k <= wordLine; k++) {
			for (int j = 1; j <= wordCount; j++) {

				for (int i = 0; i < wordLength; i++) { // For each letter in the
														// word
					char tmp = (char) ('a' + r.nextInt('z' - 'a')); 
					if (j < wordCount)
						sb.append(tmp + " ");
					else
						sb.append(tmp);// Add it to the String
				}
			}
			sb.append("\n");
		}
		return sb.toString();
	}


}
